package cn.itcast.sy7.listener;

import jakarta.servlet.*;
import jakarta.servlet.http.*;
import jakarta.servlet.annotation.*;

@WebListener

public class MyListener implements ServletContextListener, HttpSessionListener, ServletRequestListener {
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("ServletContext对象被创建了");
    }

    public void contextDestroyed(ServletContextEvent sce) {
        System.out.println("ServletContext对象被销毁了");
    }

    public void requestInitialized(ServletRequestEvent sre) {
        System.out.println("ServletRequest对象被创建了");
    }

    public void requestDestroyed(ServletRequestEvent sre) {
        System.out.println("ServletRequest对象被销毁了");
    }

    public void sessionCreated(HttpSessionEvent se) {
        System.out.println("HttpSession对象被创建了");
    }

    public void sessionDestroyed(HttpSessionEvent se) {
        System.out.println("HttpSession对象被销毁了");
    }
}